package com.bolt.report.definition;

import java.util.Map;

public class HyperlinkDefinition {

    private String reportId;
    /**
     * 参数
     */

    private Map<String, String> parameter;

    /**
     * 弹出方式（0 当前页面 1 新窗口）
     */
    private Integer ejectType;

    /**
     * 链接名称
     */
    private String linkName;

    /**
     * 请求方法0-get,1-post
     */
    private String httpMethod;

    /**
     * 链接方式(0 网络报表 1 网络连接 2 图表联动)
     */
    private String linkType;

    private String httpUrl;

    /**
     * 联动图表的ID
     */
    private String linkChartId;

    /**
     * 表达式
     */
    private String script;

    public String getReportId() {
        return reportId;
    }

    public void setReportId(String reportId) {
        this.reportId = reportId;
    }

    public Map<String, String> getParameter() {
        return parameter;
    }

    public void setParameter(Map<String, String> parameter) {
        this.parameter = parameter;
    }

    public Integer getEjectType() {
        return ejectType;
    }

    public void setEjectType(Integer ejectType) {
        this.ejectType = ejectType;
    }

    public String getLinkName() {
        return linkName;
    }

    public void setLinkName(String linkName) {
        this.linkName = linkName;
    }

    public String getHttpMethod() {
        return httpMethod;
    }

    public void setHttpMethod(String httpMethod) {
        this.httpMethod = httpMethod;
    }

    public String getLinkType() {
        return linkType;
    }

    public void setLinkType(String linkType) {
        this.linkType = linkType;
    }

    public String getHttpUrl() {
        return httpUrl;
    }

    public void setHttpUrl(String httpUrl) {
        this.httpUrl = httpUrl;
    }

    public String getLinkChartId() {
        return linkChartId;
    }

    public void setLinkChartId(String linkChartId) {
        this.linkChartId = linkChartId;
    }

    public String getScript() {
        return script;
    }

    public void setScript(String script) {
        this.script = script;
    }


    public String getUrlTargetType() {
        if (this.ejectType == 0) {
            return "_self";
        } else if (this.ejectType == 1) {
            return "_blank";
        } else {
            return "_blank";
        }
    }
}